package com.keray.common.exception;

import com.keray.common.CommonResultCode;
import com.keray.common.Result;
import com.keray.common.utils.QpsLimit;

public class QpsExceptionHandler implements ExceptionHandler<QpsLimit.QPSFailException> {

    @Override
    public boolean supper(Throwable e) {
        return e instanceof QpsLimit.QPSFailException;
    }

    @Override
    public Result<?> errorHandler(QpsLimit.QPSFailException error) {
        return Result.fail(CommonResultCode.limitedAccess);
    }
}
